﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Analysis.aspx.cs" Inherits="ZLDC.Estate.AM.Analysis" %>
<%@ Register Src="../UserControl/Dept_Tree.ascx" TagName="Dept_Tree" TagPrefix="uc1" %>

<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
    Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>量化分析</title>
    <link href="../css/main.css" rel="stylesheet" type="text/css" />
    <link href="../js/jquery/style/jquery.hiAlerts.css" rel="stylesheet" type="text/css" />
    <link href="../js/jquery/style/jquery.simple.tree.css" rel="stylesheet" type="text/css" />

    <script src="../js/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>

    <script src="../js/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
    $(document).ready(function() {
        showReprot();
    });
    function chkCon() {
        var obj = document.getElementById("tbDate1");
        var s = new String(obj.value);
        s = s.trim();
        if (s.len() == 0) {
            alert("请输入起始日期!");
            obj.focus();
            return false;
        }
        if (!s.isValidDate()) {
            alert("起始日期格式错误!");
            obj.focus();
            return false;
        }
        var obj1 = document.getElementById("tbDate2");
        var s1 = new String(obj1.value);
        s1 = s1.trim();
        if (s1.len() == 0) {
            alert("请输入截止日期!");
            obj1.focus();
            return false;
        }
        if (!s1.isValidDate()) {
            alert("截止日期格式错误!");
            obj1.focus();
            return false;
        }
        if (compareDate(obj.value, obj1.value)) {
            alert("截止日期早于开始日期!");
            obj.focus();
            return false;
        }
        document.getElementById("messageZone").style.display = "block";
    }


    // 打开报表  
    function showReprot() {
        var deptId = $("#utxdeptid").val();             // 部门ID
        var deptname = $("#utxtmain").val();             // 部门ID           
        var startDate = $("#iStartDay").val();           // 日期
        var endDate = $("#iEndDay").val();             // 日期
        var dtype = $("#ReportSelectDDL").val();             // 类型

        document.getElementById("reportsDetail").src = "../Reports/ReportPages/AnalysisReport_Page.aspx?typeid=" + dtype + "&deptid=" + deptId + "&startDate=" + escape(startDate) + "&endDate=" + escape(endDate) + "&deptname=" + escape(deptname);
    }

    </script>

</script>

</head>
<body>
    <form id="form1" runat="server">
    <div id="divSearch" style="margin-top: 5px; text-align: center;">
        <table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#a8c7ce">
            <tr>
                <td style="width: 45%; text-align: left; background-color: #FFFFFF; cursor: pointer;"
                    valign="middle">
                    部门：<uc1:Dept_Tree ID="Dept_Tree1" runat="server" />
                    &nbsp;
                    &nbsp;
         报表选择：<asp:DropDownList ID="ReportSelectDDL" runat="server" >
        <asp:ListItem Text="卖单量化分析" Value="1" Selected="True" ></asp:ListItem>
        <asp:ListItem Text="租单量化分析" Value="2"></asp:ListItem>
<%--        <asp:ListItem Text="卖单区域对比" Value="3"></asp:ListItem>
        <asp:ListItem Text="租单区域对比" Value="4"></asp:ListItem>
        <asp:ListItem Text="卖单成交明细" Value="5"></asp:ListItem>
        <asp:ListItem Text="租单成交明细" Value="6"></asp:ListItem>
--%>        </asp:DropDownList>&nbsp;&nbsp;
                     时间:<input id="iStartDay" name="iStartDay" runat="server" onclick="WdatePicker()" style="width: 100px;" />
                    ~
                    <input id="iEndDay" name="iEndDay" runat="server" onclick="WdatePicker()" style="width: 100px;" />
                 
                 <input id="btnSearch" class="button_bak" type="button" value="查询" onclick="return showReprot()" />
                </td>
            </tr>
        </table>
    </div>
    <div>
        <iframe id="reportsDetail" frameborder="0" scrolling="no" width="100%" height="500"
            src="" />        
    </div>
    </form>
</body>
</html>
